package com.mall.ibatis.bean;

import java.io.Serializable;
import com.mall.util.StringUtil;
import com.thoughtworks.xstream.XStream;

@SuppressWarnings("serial")
public class FunctionMenu implements Serializable,ICell
{
	
	 /* Private Fields */
	private String menuID;
	private String menuName;
	private String menuAction;
	private String menuLabel;
	private String menuView;
	private String isLeaf;
	private Integer menuLevel;
	private String rootID;
	private String parentID;
	private Integer displayOrder;
	private String inputValue;
	private String inputKey;
	private String menuSeq;
	private String useType;
	
	/* JavaBeans Properties */
	public String getMenuID()
	{
		return menuID;
	}
	public void setMenuID(String menuID)
	{
		this.menuID = menuID;
	}
	public String getMenuName()
	{
		return menuName;
	}
	public void setMenuName(String menuName)
	{
		this.menuName = menuName;
	}
	public String getMenuAction()
	{
		return menuAction;
	}
	public void setMenuAction(String menuAction)
	{
		this.menuAction = menuAction;
	}
	public String getMenuLabel()
	{
		return menuLabel;
	}
	public void setMenuLabel(String menuLabel)
	{
		this.menuLabel = menuLabel;
	}
	public String getMenuView()
	{
		return menuView;
	}
	public void setMenuView(String menuView)
	{
		this.menuView = menuView;
	}
	public String getIsLeaf()
	{
		return isLeaf;
	}
	public void setIsLeaf(String isLeaf)
	{
		this.isLeaf = isLeaf;
	}
	public Integer getMenuLevel()
	{
		return menuLevel;
	}
	public void setMenuLevel(Integer menuLevel)
	{
		this.menuLevel = menuLevel;
	}
	public String getRootID()
	{
		return rootID;
	}
	public void setRootID(String rootID)
	{
		this.rootID = rootID;
	}
	public String getParentID()
	{
		return parentID;
	}
	public void setParentID(String parentID)
	{
		this.parentID = parentID;
	}
	public Integer getDisplayOrder()
	{
		return displayOrder;
	}
	public void setDisplayOrder(Integer displayOrder)
	{
		this.displayOrder = displayOrder;
	}
	public String getInputValue()
	{
		return inputValue;
	}
	public void setInputValue(String inputValue)
	{
		this.inputValue = inputValue;
	}
	public String getInputKey()
	{
		return inputKey;
	}
	public void setInputKey(String inputKey)
	{
		this.inputKey = inputKey;
	}
	public String getMenuSeq()
	{
		return menuSeq;
	}
	public void setMenuSeq(String menuSeq)
	{
		this.menuSeq = menuSeq;
	}
	public String getUseType()
	{
		return useType;
	}
	public void setUseType(String useType)
	{
		this.useType = useType;
	}
	
	/* ICell method*/
	public String toCell()
	{
		// TODO Auto-generated method stub
		StringBuffer cellBuffer  = new StringBuffer();
		cellBuffer.append("<menuID><![CDATA[" + StringUtil.null2Empty(menuID)+"]]></menuID>");
		cellBuffer.append("<menuName><![CDATA[" + StringUtil.null2Empty(menuName)+"]]></menuName>");
		cellBuffer.append("<menuAction><![CDATA[" + StringUtil.null2Empty(menuAction)+"]]></menuAction>");
		cellBuffer.append("<menuLabel><![CDATA[" + StringUtil.null2Empty(menuLabel)+"]]></menuLabel>");
		cellBuffer.append("<menuView><![CDATA[" + StringUtil.null2Empty(menuView)+"]]></menuView>");
		cellBuffer.append("<isLeaf><![CDATA[" + StringUtil.null2Empty(isLeaf)+"]]></isLeaf>");
		cellBuffer.append("<menuLevel><![CDATA[" + StringUtil.integerToString(menuLevel)+"]]></menuLevel>");
		cellBuffer.append("<rootID><![CDATA[" + StringUtil.null2Empty(rootID)+"]]></rootID>");
		cellBuffer.append("<parentID><![CDATA[" + StringUtil.null2Empty(parentID)+"]]></parentID>");
		cellBuffer.append("<displayOrder><![CDATA[" + StringUtil.integerToString(displayOrder)+"]]></displayOrder>");
		cellBuffer.append("<inputValue><![CDATA[" + StringUtil.null2Empty(inputValue)+"]]></inputValue>");
		cellBuffer.append("<inputKey><![CDATA[" + StringUtil.null2Empty(inputKey)+"]]></inputKey>");
		cellBuffer.append("<menuSeq><![CDATA[" + StringUtil.null2Empty(menuSeq)+"]]></menuSeq>");
		cellBuffer.append("<useType><![CDATA[" + StringUtil.null2Empty(useType)+"]]></useType>");
		return cellBuffer.toString();
	}
	
	public String getCellID()
	{
		
		return StringUtil.null2Empty(menuID);
		
	}
	
	public String toXML()
	{
		XStream xStream = new XStream();
		xStream.alias(this.getClass().getSimpleName(),this.getClass());
		return xStream.toXML(this);
	}
}